<template>
    <view class="content">
       <u-navbar 
       :is-fixed="isFixed" leftIcon="arrow-left" :rightText="rightText" :title="title" :bgColor="background" 
       :autoBack="false" @leftClick="backButton" @rightClick="actionRight">
        </u-navbar>
        <view style="margin-top: 44px; font-size: 33rpx;">
                    子View距顶部44px(自导航栏默认高度)
        </view>
        <u-button text="网络请求" color="linear-gradient(to right, rgb(66, 83, 216), rgb(213, 51, 186))" @tap="sendRequestPinganFinanceTaskInfo"></u-button>
        <u--text :text="netWorkContent"></u--text>
        <u--image src="../../static/open-wallet.png" width="400rpx" :fade="true" duration="5000"
         mode="widthFix" shape="square" border-radius="10rpx" style="margin-top: 50rpx;"></u--image>
    </view>
</template>

<script>
    import {mapState,mapMutations} from 'vuex'
    import {walletHomeBack} from '@/common/util'
    import {getPinganFinanceTaskInfo} from '../../common/api/common.js'
    export default {
        data() {
            return {
                title: '钱包主页',
                backText: '',
                backIconName: 'nav-back',
                showAction: false,
                useSlot: false,
                rightText:"",
                background:"#FFFFFF",
                isBack: false,
                isFixed: true,
                netWorkContent:"",
                fileList:[]
            }
        },
        computed: {
        	...mapState(['myInfo']),
        	 businessId(){
        		 return this.$store.state.myInfo.businessId
        	 }
        },
        onLoad(e) {
            
        },
        methods: {
            backButton() {
                console.log("backButton")
                localStorage.removeItem('myInfo');
                walletHomeBack();
            },
            actionRight() {
                console.log("actionRight")
            },
            sendRequestPinganFinanceTaskInfo() {
                let that = this
                getPinganFinanceTaskInfo({"userId": "02wmsRjIECmeiNQOqjNRR5WYcPOqqvx1"}).then((res)=>{
				    if(res.body.success) {
					    let data = res.body.data;
                        console.log("data.defaultSettlementStatus: " + data.defaultSettlementStatus)
                        console.log("data.openAccountStatus: " + data.openAccountStatus)
                        that.netWorkContent = data.openAccountStatus
				    } else {
                        console.log("res.body.fail")
				    }
                })
            }
        }
    }
</script>

<style lang="scss" scoped>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
    }
</style>
